define(['jquery', 'bootstrap', 'utilback', 'table', 'form', 'myfileinput'], function($, undefined, Utilback, Table, Form, myfileInput) {

	var Controller = {
		config: {
			get_url: '/user/read/detail', // 获取用户详情
		},
		init: function() {
			this.initDic();
			this.initParam();
			this.initParam2();
			this.initParam3();
			this.initParam4();
			this.initParam5();
			this.initParam6();
			this.initParam7();
            this.initParam8();
            this.initParam9();
            this.initParam10();
            this.initParam11();
            this.initParam12();
            this.initParam13();
		},
		initDic:function(){
			// 初始化表格参数配置
			$('[href="#dic"]').on('click',function(){
				Table.api.init({
					singleSelect: true,
					extend: {
						index_url: './json/trackCarRecordDetile.json', // 查询列表
					}
				});
			});
			 $('[href="#dic"]').click();
			var table = $("#dicTable");

			// 初始化表格
			table.bootstrapTable({
				url: $.fn.bootstrapTable.defaults.extend.index_url,
				toolbar:'#toolbar',
                 singleSelect:true,
                showExport:false,
                showToggle: false,
                search:false,
                commonSearch:false,
                searchFormVisible:false,
                showColumns:false,
				method: 'get',
				columns: [
					[{
							field: 'state',checkbox: true},
						{field: 'id',title: 'ID'},
						{
							field: 'wagonNumber',
							title: '车号'
						},
                        {
                            field: 'department',
                            title: '部门'
                        },
                        {
                            field: 'storageLife',
                            title: '保存期'
                        },
						{
							field: 'driveName',
							title: "设备名称"
						},
						{
							field: 'models',
							title: "规格型号"
						},
						{
							field: 'productionDate',
							title: "出厂日期"
						},
						{
							field: 'equipmentNumber',
							title: "设备编号"
						},
						{
							field: 'productionCertificate',
							title: "生产许可证"
						},
						{
							field: 'productCompany',
							title: "生产厂家"
						},
						{
							field: 'factoryNumber',
							title: '出厂编号'
						}, {
							field: 'state',
							title: "状态"
						},
					]
				]
			});

			// 为表格绑定事件
			Table.api.bindevent(table);
		},
		initParam:function(){
			var i = 0;
                var paramTable = $('#paramTable');
                $('[href="#param"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable.bootstrapTable({
                            toolbar:'#toolbar1',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'wheelBase', title: '轴距'},
                                    {field: 'trackGauge', title: "轨距"},
                                    {field: 'enginePower', title: "发动机功率"},
                                    {field: 'wheelDiameter', title: "轮径"},
                                    {field: 'axel', title: "轴列式"},
                                    {field: 'minRadius', title: "通过最小曲线半径"},
                                    {field: 'maxSpeed', title: '最大运行速度'},
                                    {field: 'driveType', title: '传动方式'},
                                    {field: 'brakeType', title: "制动方式"},
                                    {field: 'startType', title: "启动方式"},
                                    {field: 'carCoupler', title: "车钩"},
                                    {field: 'height', title: "车钩中心距轨面高度"},
                                    {field: 'weight', title: "整体重量"},
                                    {field: 'size', title: "外形尺寸"},
                                    {field: 'maxMeal', title: "最大牵引吨位"},
                                    {field: 'distance', title: "定距"},
                                    {field: 'enginmodel', title: "发动机型号"},
                                    {field: 'airModel', title: "空调型号"},
                                    {field: 'airCompressor', title: "空压机型号"},
                                    {field: 'macheineType', title: "制动机型号"},
                                    {field: 'originalValue', title: "固资原值"},

                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable);
                        i++;
                    }
                });
		},
		initParam2:function(){
			var i = 0;
                var paramTable2 = $('#paramTable2');
                $('[href="#param2"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable2.bootstrapTable({
                            toolbar:'#toolbar2',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            add_url: 'overhaulMaintenanceAdd.html', // 新增页面
							edit_url: 'overhaulMaintenanceAdd.html', // 修改页面
                            method:'get',
                            columns:[
                                [
                                    {field: 'name', title: '名称'},
                                    {field: 'models', title: "型号"},
                                    {field: 'Num', title: "数量"},
                                    {field: 'system', title: "制式"},
                                    {field: 'factory', title: "制造工厂"},
                                
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable2);
                        i++;
                    }
                });
		},
		initParam3:function(){
			var i = 0;
                var paramTable3 = $('#paramTable3');
                $('[href="#param3"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
      
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable3.bootstrapTable({
                            toolbar:'#toolbar3',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'name', title: '名称'},
                                    {field: 'number', title: "编号"},
                                    {field: 'take', title: "修别"},
                                    {field: 'date', title: "日期"}
                                    
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable3);
                        i++;
                    }
                });
		},
		initParam4:function(){
			var i = 0;
                var paramTable4 = $('#paramTable4');
                $('[href="#param4"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable4.bootstrapTable({
                            toolbar:'#toolbar4',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'annual', title: '年度'},
                                    {field: 'useType', title: "使用别"},
                                    {field: 'Thisdistance', title: "本年度走行公里"},
                                    {field: 'allDistance', title: "累计走行公里"},
                                    {field: 'annualAppraisal', title: "年鉴定情况"},
                                    
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable4);
                        i++;
                    }
                });
		},
		initParam5:function(){
			var i = 0;
                var paramTable5 = $('#paramTable5');
                $('[href="#param5"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable5.bootstrapTable({
                            toolbar:'#toolbar5',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'sendData', title: '送修日期'},
                                    {field: 'take', title: "修别"},
                                    {field: 'unit', title: "承修单位"},
                                    {field: 'Thisdistance', title: "本年度走行公里"},
                                    {field: 'allDistance', title: "累计走行公里"},
                                    {field: 'recordNum', title: "检修记录编号"},
                                    {field: 'maintenanceMan', title: '验收人'},
                                    {field: 'Date', title: '检验日期'},
                                    
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable5);
                        i++;
                    }
                });
		},
		initParam6:function(){
			var i = 0;
                var paramTable6 = $('#paramTable6');
                $('[href="#param6"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable6.bootstrapTable({
                            toolbar:'#toolbar6',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'number', title: '序号'},
                                    {field: 'deviceName', title: "名称"},
                                    {field: 'Num', title: "数量"},
                                    {field: 'repairStation', title: "修程施修情况"},
                                    {field: 'annotation', title: "附注"},
                                   
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable6);
                        i++;
                    }
                });
		},
		initParam7:function(){
			var i = 0;
                var paramTable7 = $('#paramTable7');
                $('[href="#param7"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable7.bootstrapTable({
                            toolbar:'#toolbar7',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'projectName', title: '项目名称'},
                                    {field: 'repairUnit', title: "承修单位"},
                                    {field: 'date', title: "日期"},
                                    {field: 'contentDis', title: "内容说明"},
                                    {field: 'approve', title: "批准文件"},
                                    {field: 'endorse', title: "签认"},
                                   
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable7);
                        i++;
                    }
                });
		},
        initParam8:function(){
            var i = 0;
                var paramTable8 = $('#paramTable8');
                $('[href="#param8"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable8.bootstrapTable({
                            toolbar:'#toolbar8',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'tryDate', title: '试运日期'},
                                    {field: 'take', title: "修别"},
                                    {field: 'testDis', title: "试运期间公里"},
                                    {field: 'testResult', title: "主要项目测试结果"},
                                    {field: 'testConclusion', title: "试验结论"},
                                    {field: 'acceptor', title: "验收人"},
                                   
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable8);
                        i++;
                    }
                });
        },
        initParam9:function(){
            var i = 0;
                var paramTable9 = $('#paramTable9');
                $('[href="#param9"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable9.bootstrapTable({
                            toolbar:'#toolbar9',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'Date', title: '日期'},
                                    {field: 'troubleReson', title: "故障原因"},
                                    {field: 'handlingInfo', title: "处理情况"},
                                    {field: 'acceptorOpnion', title: "验收意见"},
                                    {field: 'repairMan', title: "承修人"},
                                    {field: 'acceptor', title: "验收人"},
                                   
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable9);
                        i++;
                    }
                });
        },
        initParam10:function(){
            var i = 0;
                var paramTable10 = $('#paramTable10');
                $('[href="#param10"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                    
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable10.bootstrapTable({
                            toolbar:'#toolbar10',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'configuration', title: '配属单位'},
                                    {field: 'route', title: "配属线路"},
                                    {field: 'confDis', title: "配属地点"},
                                    {field: 'confDate', title: "配属日期"},
                                    {field: 'principal', title: "负责人"},
                                    {field: 'notes', title: "附注"},
                                   
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable10);
                        i++;
                    }
                });
        },
        initParam11:function(){
            var i = 0;
                var paramTable11 = $('#paramTable11');
                $('[href="#param11"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                            multi_url: '/overhaulMaintenance', 
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable11.bootstrapTable({
                            toolbar:'#toolbar11',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'Date', title: '日期'},
                                    {field: 'incident', title: "事件"},
                                    {field: 'principal', title: "负责人"},
                                    {field: 'conclusion', title: "处理结论"},
                                    {field: 'other', title: "其他"},
                                   
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable11);
                        i++;
                    }
                });
        },
           initParam12:function(){
            var i = 0;
                var paramTable12 = $('#paramTable12');
                $('[href="#param12"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                            multi_url: '/overhaulMaintenance', 

                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable12.bootstrapTable({
                            toolbar:'#toolbar12',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'installationTime', title: 'GYK安装投运时间'},
                                    {field: 'manufacturer', title: "GYK生产厂家"},
                                    {field: 'purchaseSource', title: "购置来源（路局购置或新建线投资）"},
                                    {field: 'radioModel', title: "无线电台型号"},
                                    {field: 'vender', title: "无线电台厂家"},
                                   {field: 'CommissioningTime', title: "无线电台投运时间"},
                                   {field:'CIRTime',title:'CIR安装投运时间'},
                                   {field:'PurchaseSource',title:'购置来源（路局购置或新建线投资）'},
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable12);
                        i++;
                    }
                });
        },
        initParam13:function(){
            var i = 0;
                var paramTable13 = $('#paramTable13');
                $('[href="#param13"]').on('click',function(){
                    Table.api.init({
                        singleSelect:true,
                        showExport:false,
                        showToggle: false,
                        search:false,
                        commonSearch:false,
                        searchFormVisible:false,
                        showColumns:false,
                        extend:{
                            index_url: './json/overhaulMaintenance.json', // 查询列表
                            multi_url: '/overhaulMaintenance', 
                        }
                    });
                    if(i === 0){
                        
                        // 初始化表格
                        paramTable13.bootstrapTable({
                            toolbar:'#toolbar13',
                            url:$.fn.bootstrapTable.defaults.extend.index_url,
                            method:'get',
                            columns:[
                                [
                                    {field: 'model', title: '型号'},
                                    {field: 'receptionTime', title: "调试验收时间"},
                                    {field: 'commissioningTime', title: "投运时间"},
                                    {field: 'manufacturer', title: "生产厂家"},
                                ]
                            ]
                        });
                        Table.api.bindevent(paramTable13);
                        i++;
                    }
                });
        },
	};
	return Controller;

	function changeAgentContent() {
		document.getElementById("inputFileAgent").value = document.getElementById("inputFile").value;
	}
});